"""
字符串相关的工具模块
"""


def str_reverse(s):
    """
    将传入的字符串进行反转
    :param s:
    :return: 反转后的字符串
    """
    return s[::-1]


def substr(s, x, y):
    """
    按照下标x和y，对字符串进行切片
    :param s:
    :param x:
    :param y:
    :return:
    """
    return s[x:y]


if __name__ == '__main__':
    print(str_reverse("abcd"))
    print(substr("abcd", 1, 2))
